<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 基本表单</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/newWeb/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/newWeb/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/newWeb/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/newWeb/css/animate.css" rel="stylesheet">
    <link href="__PUBLIC__/newWeb/css/style.css?v=4.1.0" rel="stylesheet">
    <style>
        .form-group .radio{
            display: inline-block;
        }
    </style>
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>新增角色</h5>
                    </div>
                    <div class="ibox-content">
                        <form method="post" class="form-horizontal"  action="__ACTION__">
                          
                            <div class="form-group">
                                <label class="col-sm-2 control-label">角色名称</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="rolename"  value="{$info.rolename|default=''}">
                                </div>
                            </div>  
                            <div class="form-group">
                                <label class="col-sm-2 control-label">备注</label>
                                <div class="col-sm-3">
                                    <textarea  class="form-control" name="remark">{$info.remark|default=''}</textarea>
                                </div>
                            </div>



                         <label class="col-sm-2 control-label">选择权限：</label>
                                     <div class="col-sm-9">					
                                        <label class="checkbox-inline">
						<input type="checkbox" class="check_all" rel="{$k}"  />全选<br/>
					   </label>
                                        <volist name="permissioninfo" id="v">
						<label class="checkbox-inline">
							<input type="checkbox" name="map[]"  namevalue="ids{$k}" class="check_list{$k}" value="{$v.id}"
						<volist name="permissionfind" id="map">
							<?php if( $map['permission_id'] == $v['id'] ){ ?>
								checked
							<?php } ?>
						</volist>                                                               
                                                        > {$v.permissionname}
						</label>
					</volist>

					</div>

			                           
                                <input type="hidden" name="id" value="{$info.id|default=''}">   


                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-info" type="submit">保存</button>
                                    <button class="btn btn-white" type="submit" onclick="javascript:;history.go(-1)">取消</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <!-- 全局js -->
    <script src="__PUBLIC__/newWeb/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/newWeb/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__PUBLIC__/newWeb/js/plugins/layer/laydate/laydate.js"></script>
    <script src="__PUBLIC__/newWeb/js/plugins/iCheck/icheck.min.js"></script>
    <script>
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
        });        
        
    </script>
	<script type="text/javascript">
		
		$(function(){
			$('.check_all').click(
				function(){
					var k = $(this).attr('rel');
					
					if(  $(this).prop("checked") )
					{
						$(this).parent().addClass("checked");
						$('input[namevalue="ids'+k+'"]').parent().addClass("checked");
					}
					else
					{
						$(this).parent().removeClass("checked");
						$('input[namevalue="ids'+k+'"]').parent().removeClass("checked");
					}
					$("input[class='check_list"+k+"']").prop('checked', $(this).prop("checked"));
				}
			);
		})
	</script>    
    

</body>

</html>
